package cn.edu.nju.software.cdiy.bean;

import java.io.Serializable;
import java.util.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
public class Horder implements Serializable {

	private static final long serialVersionUID = 2668379321312804368L;
	
	private Long id;
	private Supplier supplier;
	private Date time;
	private Value state;
	private Set<OrderHardware> orderHardwares = new HashSet<OrderHardware>();
	private String remark;
	private String rsv1;
	private String rsv2;
	private String rsv3;
	/*
	public boolean equals(Object obj)
	{
		if(this==obj) return true;
		if(!(obj instanceof Horder))
			return false;
		Horder target=(Horder)obj;
		//都包含id就比较
		if(this.getId()!=null&&target.getId()!=null)
		{
			return this.getId().equals(target.getId());
		}
		//两个中有一个为空,或都空
		
			
	    if(this.getSupplier().equals(target.getSupplier())&&this.getTime().equals(target.getTime()))
	    {
	    	return true;
	    }
		
		return false;
	}

	public int hashCode()
	{
		int result=17;
		if(this.getId()!=null)
		{
			result=37*result+this.getId().hashCode();
		}
		
		if(this.getSupplier()!=null)
		{
			result=37*result+this.getSupplier().hashCode();
		}
		
		if(this.getTime()!=null)
		{
			result=37*result+this.getTime().hashCode();
		}
		return result;
	}
	*/
	public Value getState() {
		return state;
	}

	public void setState(Value state) {
		this.state = state;
	}

	public String getRsv1() {
		return rsv1;
	}

	public void setRsv1(String rsv1) {
		this.rsv1 = rsv1;
	}

	public String getRsv2() {
		return rsv2;
	}

	public void setRsv2(String rsv2) {
		this.rsv2 = rsv2;
	}

	public String getRsv3() {
		return rsv3;
	}

	public void setRsv3(String rsv3) {
		this.rsv3 = rsv3;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Supplier getSupplier() {
		return supplier;
	}

	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public Set<OrderHardware> getOrderHardwares() {
		return orderHardwares;
	}

	public void setOrderHardwares(Set<OrderHardware> orderHardwares) {
		this.orderHardwares = orderHardwares;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
}
